package com.example.demo.service.impl;

import com.example.demo.common.domain.Room;
import com.example.demo.common.domain.RoomExample;
import com.example.demo.mapper.RoomMapper;
import com.example.demo.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomServiceImpl implements RoomService {
    @Autowired
    RoomMapper roomMapper;
    @Autowired
    RoomExample roomExample;

    @Override
    public List<Room> roomList(Integer hotelId) {
        roomExample.createCriteria().andHotelIdEqualTo(hotelId);
        return roomMapper.selectByExample(roomExample);
    }

    @Override
    public Room roominfo(Integer Id) {
        return roomMapper.selectByPrimaryKey(Id);
    }
}
